package direct;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import utils.RabbitMQUtils;

import java.io.IOException;

public class Provider {
    public static void main(String[] args) throws IOException {
        Connection connection = RabbitMQUtils.getConnection();
        Channel channel = connection.createChannel();

        String exchangeName = "logs_direct";
        channel.exchangeDeclare(exchangeName, "direct");
        String routingKey = "error";
        channel.basicPublish(exchangeName, routingKey, null, ("direct route" + routingKey).getBytes());
        RabbitMQUtils.closeConnectionAndChannel(channel, connection);
    }
}
